﻿using System.Configuration;

namespace HVACWebService.Common
{
    public static class ConfigHelper
    {
        public static T GetValue<T>(string key)
        {
            return ConfigurationManager.AppSettings[key].ToObject<T>();
        }

        public static string GetConnectString(string key)
        {
            var conStr =  ConfigurationManager.ConnectionStrings[key];
            if (conStr==null)
            {
                return  ConfigurationManager.AppSettings[key].ToObject<string>();
            }
            return conStr.ToString();
        }

    }
}